﻿<?php
include('lib_db.php');
//print_r("$_REQUEST('search')");
$search = isset($_GET['search']) ? $_GET['search'] : '';
	$sqlQ = sql_str($search);
	$sql = "select * from book where Name like '%{$sqlQ}%' limit 9";
	//$sql .= " OR description like '%{$sqlQ}%'";
	//buoc 3 thuc thi
	$tim_kiem = select_list($sql);

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title> BÁN SÁCH TRỰC TUYẾN </title>
		<link type="text/css" rel="stylesheet" href="css/style.css" />
		<link href="css/js-image-slider.css" rel="stylesheet" type="text/css"/>
		<script src="js/js-image-slider.js" type="text/javascript"></script>
		<script src="js/stickytooltip.js" type="text/javascript"></script>
		<link href="css/generic.css" rel="stylesheet" type="text/css" />
	</head>
	<body>
		<div id ="wrapper">
			<div id ="header"><?php include("header.php");?></div><!--end header-->		
			<div id ="content">
				<div class="content-header"><?php include ("header-content.php");?></div> <!--end content-header-->
				
						<div class="clear-both"></div>			
				<div class="content-menu">
					<div class ="content-menu-left "><?php include ("content-menu-left.php")?></div>	<!--end content-menu-left -->					
					<div class="content-menu-center">
						
						<?php if($tim_kiem) foreach ($tim_kiem as $data){?>
					<div class="listbook">
						<div class="tieu-de">
							<a href="<?php echo $data['Link']?>?id1=<?php echo $data['idBook']?>""title="<?php echo $data['Name']?>"><?php echo $data['Name']?></a>
						</div>
						<div class="listbook-left">
							<a href="#"title="Thôi Miên Bằng Ngôn Từ"><img width="90px" height="90px" src="img1/<?php echo $data['ImgCover']?>"/></a>
							<div class="gioithieu">
								<a href="#" style="font-size:13px;color:black;text-decoration:none" 
									title="Thậm chí, nếu bạn là một nhà kinh doanh hay một nghệ sĩ  ,thì việc nổi tiếng, được nhiều người biết đến chính là “miếng cơm manh...">
									<p><?php echo $data["Description"]?></p>
								</a><br/>
								Tác giả:
								<a class="color1" title="More about Joe Vitale" href="#"><?php echo $data['Author']?></a>
								<br/>
								Dịch giả:
								<font color="#00775b" style="font-weight:bold"><?php echo $data['Translator']?></font>
							</div>
						</div>
						<div class="listbook-right">
							<div class="sach-dac-biet1221">
								<img width="245px"height="90px"src="img1/bg_price.gif"/>
								<div class="sach-dac-biet12212">
									Giá bán:
									<span class="gia-ban"><?php echo $data['SalePrice']?></span>
									<br/>
									Giá bìa:
									<font style="text-decoration: line-through;color:red;font-size:12px"><?php echo $data['CoverPrice']?></font>
								</div>
								<div class="sach-dac-biet1222" style="float:right">
									<a class="viewsp"title="view"href="#"></a>
									<a class="shopcart"title="Add to cart"href="#"></a>
								</div>
								<div class="giam-gia"style="left:30px">
									<p>Giảm <br> <?php echo $data['SaleOff']?>% </p>
								</div>
							</div>
						</div>
					</div>
					<div class="clear-both"></div>
					
					<?php } ?>
						
					</div> <!--end content-menu-center-->
					<div class ="content-menu-right"><?php include ("content-menu-right.php")?></div> <!--end content-menu-right-->
								
				</div> <!--end content-menu-->
			
			</div> <!--end content-->
			<div id ="footer"><?php include("footer.php");?></div><!--end footer-->
			
		
		</div><!--end wapper-->
	</body>
</html>